package com.southwind.phone_store_demohd.util;


import com.southwind.phone_store_demohd.vo.ResultVO;

public class ResultVOUtil {
    public static ResultVO success(Object data){//这里是返回给前端的数据
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(0);
        resultVO.setMsg("成功");
        resultVO.setData(data);
        return resultVO;
    }

    public static ResultVO error(String error){//失败传递
        ResultVO resultVO = new ResultVO();
        resultVO.setCode(1);
        resultVO.setMsg(error);
        resultVO.setData(null);
        return resultVO;
    }
}
